<?php


	// Load Elgg engine
	require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");

	// Get the specified blog post
	$guid = (int) get_input('lang');

	// If we can get out the blog post ...
	if ($entity = get_entity($guid)){
		// Set the page owner
		set_page_owner($entity->getOwner());
		$page_owner = get_entity($entity->getOwner());
		// Display it
		$area1 = elgg_view_title(elgg_echo('pel:otherlang2').' : '.$entity->description);
		$area2 = elgg_view("pel/viewlang", array('lang' => $guid));
		// Set the title appropriately
		$title = elgg_echo("pel:otherlang");
		// Display through the correct canvas area
		$body = elgg_view_layout("two_column_left_sidebar", '', $area1 . $area2);
	}
	else{
		// Display the 'post not found' page instead
		$body = elgg_view("pel/notfound");
		$title = elgg_echo("pel:notfound");
	}
	// Display page
	page_draw($title,$body);
?>